/**
 * 
 */
package com.taobao.wolfwolf.hibernate.dao.impl;

import java.util.List;


import com.taobao.wolfwolf.hibernate.dao.LogisticsDao;
import com.taobao.wolfwolf.hibernate.pojo.Logistics;

/**
 * @author Tux
 *
 * 创建时间: 2011-4-29 下午08:14:09
 */
@SuppressWarnings("unchecked")
public class LogisticsDaoImpl extends BaseDaoImpl implements LogisticsDao {

	public Logistics findById(int id) throws Exception {
		return (Logistics) getHibernateTemplate().get(Logistics.class, id);
	}
	
	public List<Logistics> findByName(String name) throws Exception {
		return super.findByProperty(Logistics.class, "name", name);
	}

	public List<Logistics> findAll() throws Exception {
		return getHibernateTemplate().find("from Logistics");
	}

	public long getTotal() throws Exception {
		return super.countByCriteria(Logistics.class);
	}

	public List<Logistics> paging(int page, int limit) throws Exception {
		return super.findByCriteriaByPage(Logistics.class, page, limit);
	}
}
